total distance traveled from a position graph